package com.topisv.tms.entity.work;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.topisv.tms.entity.IdEntity;
import com.topisv.tms.entity.User;

/**
 * 作业日志
 * @author ch
 *
 */
@Entity
@Table(name = "work_log")
public class WorkLog extends IdEntity implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	private String batchCode;
	
	private String workType;
	
	private String info;
	
	private Date workTime;
	
	private User work;
	
	public WorkLog() {
	}

	/**
	 * @param batchCode 作业批次号
	 * @param workType 操作类型 (1.创建批次 2.创建任务 3.领取拣货任务  4.完成拣货任务 5.领取灯光拣选任务 6.完成灯光拣选任务  7.领取包装任务 8完成包装任务  9.领取发货任务  10.完成发货任务  11.打印单据 )
	 * @param info 作业描述
	 * @param workTime 作业时间
	 * @param work 作业人
	 */
	public WorkLog(String batchCode,String workType, String info,
			Date workTime, User work) {
		this.batchCode = batchCode;
		this.workType = workType;
		this.info = info;
		this.workTime = workTime;
		this.work = work;
	}

	public String getBatchCode() {
		return batchCode;
	}

	public void setBatchCode(String batchCode) {
		this.batchCode = batchCode;
	}

	public String getWorkType() {
		return workType;
	}

	public void setWorkType(String workType) {
		this.workType = workType;
	}

	public String getInfo() {
		return info;
	}

	public void setInfo(String info) {
		this.info = info;
	}

	public Date getWorkTime() {
		return workTime;
	}

	public void setWorkTime(Date workTime) {
		this.workTime = workTime;
	}

	@ManyToOne
	@JoinColumn(name="worker_id", referencedColumnName="id")
	public User getWork() {
		return work;
	}

	public void setWork(User work) {
		this.work = work;
	}
 
}